﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="core_users.aspx.cs" Inherits="core_users" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="uid"
            DataSourceID="SqlDataSource1">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="uid" HeaderText="uid" ReadOnly="True" SortExpression="uid" />
                <asp:BoundField DataField="pwd" HeaderText="pwd" SortExpression="pwd" />
            </Columns>
        </asp:GridView>
        <br />
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="uid"
            DataSourceID="SqlDataSource1" Height="50px" Width="125px">
            <Fields>
                <asp:BoundField DataField="uid" HeaderText="uid" ReadOnly="True" SortExpression="uid" />
                <asp:BoundField DataField="pwd" HeaderText="pwd" SortExpression="pwd" />
                <asp:CommandField ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SparrowDB %>"
            DeleteCommand="DELETE FROM [core_users] WHERE [uid] = @uid" InsertCommand="INSERT INTO [core_users] ([uid], [pwd]) VALUES (@uid, @pwd)"
            SelectCommand="SELECT * FROM [core_users]" UpdateCommand="UPDATE [core_users] SET [pwd] = @pwd WHERE [uid] = @uid">
            <DeleteParameters>
                <asp:Parameter Name="uid" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="pwd" Type="String" />
                <asp:Parameter Name="uid" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="uid" Type="String" />
                <asp:Parameter Name="pwd" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <br />
        <asp:TextBox ID="txtOri" runat="server" MaxLength="20" TextMode="Password"></asp:TextBox>
        <br />
        <asp:Button ID="btnSHA1" runat="server" OnClick="btnSHA1_Click" Text="Encrypt" />
        <br />
        <asp:TextBox ID="txtDes" runat="server" MaxLength="40" Width="643px"></asp:TextBox></div>
    </form>
</body>
</html>
